<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>发票申请</title>
    <link rel="stylesheet" href="${ctx}/static/plug/frozenui-1.3.0/css/frozen.css" media="all">
    <style type="text/css">
       h1{
		font-size: 50px;	       
       }
       button {
		text-align: center;
		background-color: #238CC1;
		color: white;
		margin: 15px 0;
		border: 0;
		width: 100%;
		height: 50px;
		border-radius:6px;	
		}
		.address{
		width: 100%;
		height: 100px;
		background-color: #F0EFF4;
		margin-top: 12px;
		border-radius:10px;
		border: 1px solid #4e4e4e;	
		}
		.phone,.name{
		width: 100%;
		height: 24px;
		background-color: #F0EFF4;
		margin-top: 12px;
		border-radius:6px;
		border: 1px solid #4e4e4e;
		}
		.ui-container{
		margin: 0  15px;
		}
    </style>
</head>
<body>
	

<section class="ui-container">
<br>
	<h4 >我们将用邮寄方式将发票送达至您的手中，请填写邮寄信息：</h4>
	<textarea type="text" class="name" placeholder="请填写收件人（必填）"></textarea>
	<textarea type="text" class="phone" placeholder="请填写手机号码（必填）"></textarea>
	<textarea type="text" class="address" placeholder="请填写地址（必填）"></textarea>
	<button class="appeal" >提交申请</button>
	
	<h4 align="center" style="color: gray;"><span style="color: red;">*</span>提交完成后预计7个工作日内送达</h4>
</section>

</body>
<script src="${ctx}/static/plug/frozenui-1.3.0/lib/zepto.min.js"></script>
<script src="${ctx}/static/plug/frozenui-1.3.0/js/frozen.js"></script>
<script>
	$(function() {
		var paramObj = {
				"applyParams":"${applyParam}",
				"successParams":"${successParams}"
			};
		
		$(".appeal").click(function() {
			var name=$(".name").val();
			var phone=$(".phone").val();
			var address=$(".address").val();
			if(!name||!phone||!address){
				showTips("warn","姓名手机号地址都不能为空！");
				return;
			}
			if(phone.length!=11){
				showTips("warn","手机号不是11位！");
				return;
			}
			var param = {"params":paramObj.applyParams,"name":name,"phone":phone,"address":address};
			$.post("${action}", param, function(data) {
				if (data.result) {
					window.location.href = "${action}?params="+paramObj.successParams;
				} else {
					showTips("warn","系统繁忙！");
				}
			});
		});
	});
    

</script>
</html>
